#/bin/bash
id=`git log -1 --pretty=format:%h`
commit=`git log -1 --pretty=format:%H`
author=`git log -1 --pretty=format:%an`
email=`git log -1 --pretty=format:%ae`
date=`git log -1 --pretty=format:%ad --date=format:'%Y-%m-%d %H:%M:%S'`
content=`git log -1 --pretty=format:%s`

echo "{\"id\": \"$id\", \"commit\" : \"$commit\", \"author\": \"$author\", \"email\": "\$email\"", \"date\": \"$date\", \"content\": \"$content\"}"
curl -d "{\"id\": \"$id\", \"commit\" : \"$commit\", \"author\": \"$author\", \"email\": \"$email\", \"date\": \"$date\", \"content\": \"$content\"}" -H "Content-Type: application/json" -X POST http://localhost:3001/api/v1/version/create